<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>山东省足球运动协会</title>
    <!--[if lt IE 9]>
         
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
         
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <link rel="stylesheet" href="./css/main.css">
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/iconfont.css">
    <link rel="stylesheet" href="./css/jquery.sPage.css">

</head>
<style>
    .personinfo {
        margin-top: 30px;
    }

    html {
        height: 100% !important;
    }

    body {
        position: relative !important;
        min-height: 100% !important;
        box-sizing: border-box !important;
        padding-bottom: 257px !important;
        /* .footer 的高度，为 footer 占位 */
    }

    .footer {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        /*height: 207px !important;*/
    }

    .redpoint {
        background: red !important;
        width: 9px;
        height: 9px;
        border-radius: 4.5px;
        position: absolute;
        right: 3px;
        top: 3px;
        margin: 0 !important;
        padding: 0 !important;
    }
</style>

<body style="display: none;">
    <div class="head">
        <div style="background: #006633">
            <div class="container">
                <div style="line-height: 30px;color:#fff;position: absolute;font-size:12px;">山东省足球运动协会欢迎您！</div>
                <div class="do">
                    <div class="does1" style="display: block;">
                        <a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/login.html"><span>登录</span></a>
                        |
                        <a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/register.html"><span>注册</span></a>
                    </div>
                    <div class="does2" style="display:none">
                        <span>欢迎<span id="telphone" style="margin:0"></span></span>
                        |
                        <span><a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/personal.html"
                                id="nickname">个人中心</a></span>
                        |
                        <span class="logout" style="cursor: pointer;">退出</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="head-choose">
            <div class="container">
                <img src="http://newtest.sdfa.org.cn/webfile//public/headicon.png"
                    style="position: absolute;top: 15px;">
                <a href="http://newtest.sdfa.org.cn/">
                    <div class="headtext">
                        <div class="headtext1">山东省足球运动协会</div>
                        <div class="headtext2">SHANDONG FOOTBALL ASSOCIATION</div>
                    </div>
                </a>
                <div style="display:inline-block;margin-left:302px">
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/index.html?id=67">
                            <div>首页</div>
                        </a>
                        <div class="choosea-2">
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/notice.html?id=68">
                            <div>通知公告</div>
                        </a>
                        <div class="choosea-2">
                            <a href="http://newtest.sdfa.org.cn/notice.html?id=68&amp;item=1">
                                <div>公告规程</div>
                            </a>
                            <a href="http://newtest.sdfa.org.cn/notice.html?id=68&amp;item=2">
                                <div>政策法规</div>
                            </a>
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="javascript:void(0);">
                            <div>足球专区</div>
                        </a>
                        <div class="choosea-2">
                            <a href="http://newtest.sdfa.org.cn/soccernotice.html?id=70">
                                <div>女足专区</div>
                            </a>
                            <a href="http://newtest.sdfa.org.cn/prefecture.html?id=71&item=2&child=1">
                                <div>青少年足球</div>
                            </a>
                            <a href="http://newtest.sdfa.org.cn/soccernotice.html?id=72">
                                <div>社会足球</div>
                            </a>
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/otherplace.html?id=87">
                            <div>各地足协</div>
                        </a>
                        <div class="choosea-2">
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/shopping/index.htm" target="_blank">
                            <div>商城</div>
                        </a>
                        <div class="choosea-2" target="_blank">
                        </div>
                    </div>
                    <div class="choosea">
                        <a href="http://newtest.sdfa.org.cn/aboutus.html?id=77">
                            <div>关于我们</div>
                        </a>
                        <div class="choosea-2">
                        </div>
                    </div>
                </div>
                <form action="result.html" method="post">
                    <div class="input-group">
                        <input type="text" name="word" value="" autocomplete="off" class="form-control"
                            placeholder="请输入您要搜索的内容">
                        <span class="glyphicon glyphicon-search" onclick="$('.head form').submit()"></span>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="personinfo">
        <script type="text/html" id="innerpersoninfo">
            <!-- 个人信息 -->

        <!-- 判断个人团体，根据团队个人显示对应页面及链接 -->

        <div class="personinfo container">

            <!-- <div class="notice"><i class="glyphicon glyphicon-bell"></i> &emsp;您已成功认证！</div> -->
            <div class="personinfotop">
                <div class="right-btn">
                    <a href="http://newtest.sdfa.org.cn/messageList.html">
                        <span>消息中心
                            <span class="redpoint" style="display:none"></span>
                        </span>
                    </a>

                    {{if personalOrGroup=="2"}}
                    <a
                        href="http://newtest.sdfa.org.cn/footballAssociation/footBallAdmin/login.html"><span>赛事申请</span></a>
                    {{/if}}
                    {{if personalOrGroup=="1"}}
                    <a href="http://newtest.sdfa.org.cn/gradeaudit.html"><span>青少年足球等级考核</span></a>
                    {{/if}}
                    <a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/renzheng.html"><span>会员认证</span></a>
                    <a href="javascript:void(0);"><span class="changePhoneNum">解绑手机号</span></a>
                    <a href="javascript:void(0);"><span class="changePassWord">修改密码</span></a>
                </div>
            </div>
            <div class="personinfobottom">
                <img class="head" src="{{if headPortraitUrl}}{{ headPortraitUrl }}{{else}}img/default.png{{/if}}"
                    alt="">

                <div class="persontext">
                    <div class="pull-left" style="font-weight:700;font-size:28px">昵称：</div>
                    <div class="pull-left" style="font-weight:700;font-size:28px">{{ nickname }}</div>
                    {{if isVip==1}}
                    <div class="pull-left" style="font-size: 12px;color: #999999;">&emsp;
                        <span class="iconfont" style="color: #FFCC00">&#xe614;
                        </span>
                        已认证（有效期至{{ vipTime }}）
                        <a class="xufei"
                            href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/renzheng.html">续费</a>
                    </div>
                    {{else}}
                    <div class="pull-left" style="font-size: 12px;color: #999999;">&emsp;
                        <span class="iconfont" style="color: #999999">&#xe614;
                        </span>
                        <a href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/renzheng.html">未认证</a>
                    </div>
                    {{/if}}
                    <div style="text-align: right;"><a
                            href="http://newtest.sdfa.org.cn/footballAssociation/zuxie/perfect.html">查看详细资料>></a>&emsp;&emsp;
                    </div>
                    <div style="clear:both"></div>
                    {{if personalOrGroup=="1"}}
                    <div style="margin-top: 7px;color:#999">
                        当前足球评定等级：{{if level=="11"}}无等{{else}}{{level}}{{/if}}级
                        <span>&emsp;<a href="http://newtest.sdfa.org.cn/gradeaudit.html">前往评定>></a></span>
                    </div>
                    {{/if}}

                    <div style="color:#999">
                        当前用户身份：{{identity}}
                    </div>
                </div>
            </div>
        </div>
        <!-- 历史记录 -->

        <div class="history container" style="border-bottom:0">

            <div class="liulan">浏览记录</div>
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" role="tablist" style="margin-left: 145px;">
                {{if list[0]}}
                <li role="presentation" class="active" data-value={{ list[0].addTime }}>
                    <a class="firstclick" href="#date1" aria-controls="date1" role="tab" data-toggle="tab"
                        onclick="getList();pageNum = 1">{{ list[0].addTime }}</a>
                </li>
                {{/if}}
                {{if list[1]}}
                <li role="presentation" data-value={{ list[1].addTime }}>
                    <a href="#date2" aria-controls="date2" role="tab" data-toggle="tab"
                        onclick="getList();pageNum = 1">{{ list[1].addTime }}</a>
                </li>
                {{/if}}
                {{if list[2]}}
                <li role="presentation" data-value={{ list[2].addTime }}>
                    <a href="#date3" aria-controls="date3" role="tab" data-toggle="tab"
                        onclick="getList();pageNum = 1">{{ list[2].addTime }}</a>
                </li>
                {{/if}}
            </ul>
        </div>
        </script>

    </div>

    <div class="history container"
        style="border-top:0;position: relative;margin-bottom: -40px;top: -90px;padding-top: 0px;">
        <div id="history">
            <script type="text/html" id="historylist">
                <!-- Tab panes -->
            <div class=" noticemain">
                <div id="date1">
                    {{each list value i}}
                    {{if list[i].type==1}}
                    <div>
                        <div class="item2">
                            <div class="col-xs-1" style="height: 210px;line-height:210px;">{{time[i]}}</div>
                            <div class="col-xs-11">
                                <div class="img">
                                    <img src="{{value.videoImgUrl}}" alt="">
                                </div>
                                <div style="font-size: 16px;line-height: 53px;">{{value.videoTitle}}</div>
                            </div>
                        </div>
                    </div>
                    {{else if list[i].type==2}}
                    <div class="item">
                        <div class="col-xs-1" style="height: 176px;line-height:176px;">{{time[i]}}</div>
                        <div class="col-xs-11">
                            <div class="noticelist">
                                <div class="listimg">
                                    <img src="{{value.messageImgUrl}}" alt="">
                                </div>
                                <div class="listtext">
                                    <a href="http://newtest.sdfa.org.cn/noticedetailed.html?id={{value.accessId}}">
                                        <div class="texttitle">
                                            <div class="titleicon">通知</div>
                                            <div class="titletext">{{value.messageTitle}}</div>
                                        </div>
                                    </a>
                                    <div class="texttext">
                                        {{value.content}}
                                    </div>
                                    <div class="texttime"> {{value.messageAddTime}}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    {{/if}}
                    {{/each}}
                </div>
            </div>
            </script>
        </div>
        <div id="myPage" style="text-align: center;margin-top:20px"></div>
    </div>


    <!-- 底部 -->
    <div class="footer" style="min-width: 100%;">
        <div>
            版权所有：山东省足球运动协会官方网站
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            ICP经营许可证：鲁ICP备15020327号
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            山东乐体网络科技有限公司
        </div>
    </div>

</body>
<script src="./js/jquery.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/artTemplate.js"></script>
<script src="./js/jquery.sPage.js"></script>
<script src="./js/layer/layer.js"></script>

<script>
    // 全局缓存global_nickName
    var global_nickName = sessionStorage.nickName;
    var global_userId = sessionStorage.userId;
    if (global_userId) {
        $('.do .does1').css('display', 'none')
        $('.do .does2').css('display', 'block')
    } else if (global_nickName == undefined || global_nickName == "") {
        $('.do .does1').css('display', 'block')
        $('.do .does2').css('display', 'none')
    }
    var global_tel = sessionStorage.tel;
    $("#telphone").text(global_tel)
    //退出
    $('.logout').click(function () {
        myAjax('/user/logout', {},
            function (data) {
                console.log(data)
                if (data.msg == 0) {
                    sessionStorage.clear()
                    window.location.href = "http://newtest.sdfa.org.cn/index.html"
                }
            },
            function (err) {
                console.log(err)
            })
    });
    var dat;
    $(document).ready(function () {
        getUser();

    })

    /**
     * 获取url请求前缀
     * @return http://127.0.0.1/cheliangzhihui
     */
    function getRequestPrefix() {
        // return "http://192.168.0.160:8083/footballAssociation"
        return "http://newtest.sdfa.org.cn/footballAssociation"
        // 获取网络协议
        // 获取主机名+端口号
        var domainPort = window.location.host;
        // 获取发布项目的名称
        // 获取路径
        var url = window.location.pathname;
        var webApp = url.split('/')[1];
        // http://127.0.0.1/demo
        var urlPrefix = "http://" + domainPort + "/" + webApp;
        return urlPrefix;
    }

    // 获取昵称等
    function getUser() {
        $.ajax({
            // url: "http://192.168.0.160:8083/footballAssociation/user/findUserAddTimeByUserId",
            url: getRequestPrefix() + '/user/findUserAddTimeByUserId',
            type: "POST",
            // 设置的是请求参数
            data: {
                userId: global_userId,
            },
            // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
            dataType: 'json',
            success: function (res) {
                $("body").fadeIn()
                console.log(res)
                data1 = {
                    list: res.list,
                    nickname: res.user.nickName,
                    documentNumber: res.user.documentNumber,
                    isVip: res.user.isVip,
                    vipTime: res.user.vipTime,
                    headPortraitUrl: res.user.headPortraitUrl,
                    personalOrGroup: res.user.personalOrGroup,
                    level: res.user.level,
                    identity: res.user.identity
                };
                var html = template('innerpersoninfo', data1);
                document.getElementById("personinfo").innerHTML = html;
                $('.firstclick').click();
            }
        })
    }

    // 获取选项卡显示时间
    function getDate() {
        var p = new Promise(function (resolve, reject) {
            setTimeout(function () {
                date = ($(".nav-tabs .active").attr("data-value"))
                resolve(date);
            }, 50);
        });
        return p
    }

    // 根据选项卡点击事件获取对应列表
    function getList() {
        getDate().then(function (data) {
            $.ajax({
                // url: "http://192.168.0.160:8083/footballAssociation/user/findUserByUserId",
                url: getRequestPrefix() + '/user/findUserByUserId',
                type: "POST",
                // 设置的是请求参数
                data: {
                    userId: global_userId,
                    addTime: date,
                    page: pageNum

                },
                dataType: 'json',
                success: function (res) {
                    var time = [];
                    for (var i = 0; i < res.page.list.length; i++) {
                        var d = new Date(Date.parse(res.page.list[i].addTime.replace(/-/g,
                            "/")));
                        var hour = d.getHours();
                        var minute = d.getMinutes();
                        time.push(hour + ":" + minute)
                    }

                    data2 = {
                        list: res.page.list,
                        time: time
                    };
                    var html = template('historylist', data2);
                    document.getElementById("history").innerHTML = html;
                    // 分页
                    $("#myPage").sPage({
                        page: pageNum, //当前页码，必填
                        total: res.page.totalRow, //数据总条数，必填
                        pageSize: 10, //每页显示多少条数据，默认10条
                        showTotal: true, //是否显示总条数，默认关闭：false
                        totalTxt: "共{total}条", //数据总条数文字描述，{total}为占位符，默认"共{total}条"
                        noData: false, //没有数据时是否显示分页，默认false不显示，true显示第一页
                        showSkip: true, //是否显示跳页，默认关闭：false
                        showPN: true, //是否显示上下翻页，默认开启：true
                        prevPage: "上一页", //上翻页文字描述，默认“上一页”
                        nextPage: "下一页", //下翻页文字描述，默认“下一页”
                        backFun: function (page) {
                            pageNum = page;
                            getList()
                        }
                    });
                }
            })
        });
    }

    function myAjax(url, data, callback, errFn) {
        $.ajax({
            url: getRequestPrefix() + url,
            type: 'get',
            data,
            dataType: 'json',
            success: function (data) {
                callback(data)
            },
            error: function (err) {
                errFn(err)
            }
        });
    }

    $("body").on("click", ".changePhoneNum", function () {
        layer.open({
            type: 2,
            content: 'changePhoneNum.html',
            area: ["500px", "400px"],
            title: "解绑手机号",
            shadeClose: true, //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
            success: function (layero, index) {
                var body = layer.getChildFrame('body', index);
                var iframeWin = window[layero.find('iframe')[0]['name']];
                body.find(".phone1").val(sessionStorage.tel);
            }
        });
    })
    $("body").on("click", ".changePassWord", function () {
        layer.open({
            type: 2,
            content: 'changePassWord.html',
            area: ["500px", "450px"],
            title: "修改密码",
            // btn: ['确认', '取消'],//开启显示按钮功能
            // btnAlign: 'c',//居中显示按钮
            // shade:true,
            shadeClose: true, //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
        });
    })

    setTimeout(function () {
        $.ajax({
            // url: "http://192.168.0.160:8083/footballAssociation/user/findUserAddTimeByUserId",
            url: getRequestPrefix() + '/user/getMessageUnReadList',
            type: "POST",
            // 设置的是请求参数
            data: {},
            // 用于设置响应体的类型 注意 跟 data 参数没关系！！！
            dataType: 'json',
            success: function (res) {
                if (res.count > 0) {
                    $(".redpoint").css("display", "block")
                }

            }
        })
    }, 200);
</script>

</html>